#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

ll a, b;

/*
 given n = (a - 1) * (b - 1)
 n = a * b - a - b + 1
 as a * x0 - b * y0 = 1
 n = a * b - a - b + a * x0 - b * y0
 n = a * (x0 - 1) + b * (a - 1) could be express be a and b
 n2 = n - 1 = a * b - a - b
    = a * (b - 1) - b
    = b * (a - 1) - a
 n2 could not be expressed by a and b
 n3 = n2 + d (1 <= d <= n2)
    = a * b - a - b + d
 d = a * d * x0 - b * d * y
    = a * x1 - b * y1 (x1 < b, y1 < a)
 n3 = a * b - a - b + a * x1 - b * y1
    = a * (x1 - 1) + b * (a - 1 - y1)
 n3 could be expressed by a and b
 */
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> a >> b;
  cout << (a - 1) * (b - 1) - 1;
  return 0;
}